package com.shsxt.crm.controller.sys;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.shsxt.common.util.Result;
import com.shsxt.crm.model.YgUser;
import com.shsxt.crm.service.ISystemUserService;
import com.shsxt.framework.context.BaseController;

/**
 * 用户信息管理
 * 
 * @author Mr.YongGan.Zhang
 */

@Controller
@RequestMapping("/sysuser")
public class SystemUserController extends BaseController {

	@Autowired
	private ISystemUserService systemUserService;

	@GetMapping("index.shtml")
	public String index() {
		return "user";
	}

	@PostMapping("/queryUsersByParams")
	@ResponseBody
	public Map<String, Object> queryUsersByParams(YgUser ygUser) {
		return systemUserService.queryUsersByParams(ygUser);
	}

	@PostMapping("/insert")
	@ResponseBody
	public Result insertSystemUser(YgUser ygUser) {
		return systemUserService.insertSystemUser(ygUser);
	}

	/**
	 * 删除 用户记录
	 * 
	 * @param ids
	 * @return
	 */
	@PostMapping("/delete")
	@ResponseBody
	public Result delSystemUser(Integer[] ids) {
		return systemUserService.delSystemUser(ids);
	}
}
